Skip to main content

Configuration File

ApertureDB uses a configuration file (following a JSON format) that can be specified when starting the server using the "-cfg" flag:

./aperturedb -cfg config.json

If no configuration file is specified, ApertureDB will try to open the default file (config.json), and will fail to initiate if the file is not found.

Parameters

All the parameters in the configuration file are optional, as ApertureDB has default values for all of them.

All parameters can also be specified as environment variables, using the prefix "ADB_" and the parameter name in upper case. For instance, the parameter "port" can be specified as "ADB_PORT", and the parameter "session_token_max_age_sec" can be specified as "ADB_SESSION_TOKEN_MAX_AGE_SEC".

Note that environment variables will override the values specified in the configuration file.

Here is the list of all supported parameters:

ParameterExplanationDefault
portTCP port for incoming connections55555
max_simultaneous_clientsNumber of max simultaneous connections open500
max_connection_message_size_mbMaximum size of the query/response message in MB256
force_sslFlag that indicated whether or not SSL-based communication will be enforced by the servertrue
db_root_pathPath to the root folder where all filed/objects will be storeddb
enable_dfsEnable/disable use of distributed file system / object store.false
log_pathDirectory where logs will be placed."/tmp"
log_levelLevels INFO, WARNING, ERROR, and FATAL are 0, 1, 2, and 3, respectively1 (WARNING)
verbose_log_levelVerbosity level beyond INFO, for debugging. Will set log_level = 0. Check Google glog documentation for details-1 (no verbosity beyond INFO)
log_cerr_thresholdSpecify level of logging which will also be sent to stderr3 (FATAL)
enable_audit_logsEnable/disable audit logstrue
include_audit_logsWhen true, audit logs will be included in ApertureDB logsfalse
kvgd_db_sizeMaximum size of the graph database in MB10
kvgd_db_syncEnable/disable sync operation to disk on every transaction. When disable, latency will decrease but data loss may occur in case of crashtrue
locale_nameLocale used for string comparisonen_US
zk_serversComma-separated list of Zookeeper server:port""
zk_prefixSame instance of Zookeeper can be used by multiple aperturedb clusters. Each cluster uses a different prefix to provide isolation between clusters. The config parameter zk_prefix specifies the path for the instance."testing"
checkpoints_to_keepNumber of checkpoints that will be kept for recovery12
seconds_between_checkpointsInterval in seconds between checkpoints7200 (2 hours)
commits_between_checkpointsNumber of commits between checkpoints1024
collect_thread_intervalNumber of seconds between collecting system status information1
collect_interval_setAn array of look-back intervals, in seconds, over which system status information is averaged[5,10,30,120]
resources_check_mem_limitLimit on percentage of memory utilization after which queries are stopped93
resources_check_sleepNumber of seconds between resource utilization checks2
batch_time_to_liveNumber of seconds that a batch is kept in memory before being cleanup up60
batch_cleaner_intervalNumber of seconds between batch cleanup operations10
descriptorset_flusher_intervalNumber of seconds between descriptor set cleanup operations1800
session_token_max_age_secMaximum duration of a session, in seconds36000
refresh_token_max_age_secMaximum duration of a refresh token, in seconds360000

Config File Example

Here is an example configuration file that has all the parameters with its default values. There is no need to specify any parameter if you want to work with default values.

// ApertureDB Config File
// All parameters show the default values.
{
// Network
"port": 55555,
"max_simultaneous_clients": 500,
"max_connection_message_size_mb": 256,
"force_ssl": true,

// DB paths
"db_root_path": "db",
"blobs_path": "db/blobs",
"images_path": "db/images",
"videos_path": "db/videos",
"descriptors_path": "db/descriptors",

// Log parameters
"log_path": "/tmp/",
"log_level": 1, // Warnings only
"verbose_log_level": 0,
"log_cerr_threshold": 3,

// Batching parameters
"batch_cleaner_interval": 10,
"batch_time_to_live": 60,

// Resource Check parameters
"resources_check_sleep": 2,
"resources_check_mem_limit": 93,

// Telemetry collection parameters
"collect_thread_interval": 1,
"collect_interval_set": [5,10,30,120]

"more-info": "ApertureDB"
}

Default Directories Structure

By default, ApertureDB will create a directory structure as follows:

db
├── blobs
├── descriptors
├── graph
└── images
├── jpg
├── png
└── videos